package com.piz.model.common;


public enum ItemCategoryEnum {
	
	 PIZZA(1, "pizza"), BURGER(2, "burger"), TOPPING(4, "topping") , APPETIZERS(3, "appetizers");
	
	 
	 private int categoryId; 

	private String categoryName;
	
	ItemCategoryEnum(int categoryId, String categoryName)
	  {
	    this.categoryId = categoryId;
	    this.categoryName = categoryName;
	  }
	
	// the valueOfMethod
	  public static ItemCategoryEnum valueOf(int value) throws Exception
	  {
	    switch (value)
	    {
	      case 1 :
	        return PIZZA;
	      case 2 :
	        return BURGER;
	      case 3 :
	        return TOPPING;
	      case 4 :
	        return APPETIZERS;
	     

	    }
	    throw new Exception("Could not find Category Type for Id:" + value);
	  }

	  // the valueOfMethod
	  public static ItemCategoryEnum valueOfString(String name) throws Exception
	  {
		  ItemCategoryEnum[] values = ItemCategoryEnum.values();
	    for (ItemCategoryEnum category : values)
	    {
	      if (name.equals(category.categoryName))
	      {
	        return category;
	      }
	    }
	    throw new Exception("Could not find Activity Type for name:" + name);
	  }

	  // the identifierMethod
	  public int getId()
	  {
	    return categoryId;
	  }

	  public String getName()
	  {
	    return this.categoryName;
	  }


}
